* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5ff;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #b8c6ff 0%, #e0b0ff 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(168, 150, 255, 0.2);
}

.cakes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.cake-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(168, 150, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e6e6ff;
}

.cake-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(168, 150, 255, 0.2);
}

.cake-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #f0f0ff;
}

.cake-info {
    padding: 15px;
    background-color: #fafaff;
}

.cake-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #5a5a8a;
}

.cake-price {
    color: #8a7bff;
    font-weight: bold;
    margin-bottom: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background-color: #f0f0ff;
    border: 1px solid #d6d6ff;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    color: #7a6bff;
}

.quantity-btn:hover {
    background-color: #e6e6ff;
}

.quantity-input {
    width: 50px;
    height: 30px;
    text-align: center;
    margin: 0 10px;
    border: 1px solid #d6d6ff;
    border-radius: 4px;
    background-color: #fafaff;
    color: #5a5a8a;
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #8a7bff 0%, #b88cff 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.add-to-cart:hover {
    background: linear-gradient(135deg, #7a6bff 0%, #a87cff 100%);
    box-shadow: 0 4px 10px rgba(138, 123, 255, 0.3);
}

.cart-container {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(168, 150, 255, 0.15);
    z-index: 100;
    border: 1px solid #e6e6ff;
}

.cart-count {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8a7bff 0%, #b88cff 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    margin-left: 5px;
}

.cart-items {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0ff;
    color: #5a5a8a;
}

/* 自定义滚动条 */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f5f5ff;
}

.cart-items::-webkit-scrollbar-thumb {
    background-color: #c6b6ff;
    border-radius: 3px;
}

/* 购物车数量显示 */
.cart-count {
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 14px;
    margin-left: 5px;
}

/* 购物车页面样式 */
.cart-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.empty-cart {
    text-align: center;
    padding: 50px 20px;
}

.empty-cart h3 {
    color: #333;
    margin-bottom: 10px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 20px;
}

.continue-shopping {
    display: inline-block;
    background-color: #4e54c8;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.continue-shopping:hover {
    background-color: #3a40b0;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.cart-table th,
.cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}


.cart-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.cart-item-info {
    display: flex;
    align-items: center;
    min-width: 150px;
}

.cart-item-image {
    /* 核心：固定宽高，确保所有图片大小一致 */
    width: 30px;    /* 固定宽度（可根据需求调整，如 60px/100px） */
    height: 30px;   /* 固定高度，与宽度一致保持正方形 */
    object-fit: cover; /* 保持图片比例，裁剪多余部分（不拉伸变形） */
    margin-right: 15px;
    border-radius: 5px;
    display: block;
    /* 避免图片因原始尺寸过小而拉伸模糊 */
    min-width: 80px;
    min-height: 80px;
}


.remove-item {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 14px;
}

.remove-item:hover {
    text-decoration: underline;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.total-price {
    font-size: 18px;
    font-weight: bold;
}

.price {
    color: #ff6b6b;
    font-size: 24px;
}

.cart-actions {
    display: flex;
    gap: 15px;
}

.checkout-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.checkout-btn:hover {
    background-color: #ff5252;
}

/* 更新按钮 */
.update-item {
    color: #4e54c8;
    text-decoration: none;
    font-size: 14px;
    margin-left: 5px;
}

.update-item:hover {
    text-decoration: underline;
}
.quantity-btn {
    width: 30px;
    height: 30px;
    background-color: #f0f0ff;
    border: 1px solid #d6d6ff;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    color: #7a6bff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #e6e6ff;
}

.quantity-value {
    width: 40px;
    text-align: center;
    font-weight: bold;
    margin: 0 10px;
}
/* 首页样式 */
.home-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(168, 150, 255, 0.1);
}

.home-header {
    text-align: center;
    margin-bottom: 30px;
    color: #5a5a8a;
}

.home-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

/* 登录和注册页面样式 */
.login-register-container {
    max-width: 480px;
    margin: 80px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(168, 150, 255, 0.1);
    border: 1px solid #e6e6ff;
}

.login-register-header {
    text-align: center;
    margin-bottom: 20px;
    color: #5a5a8a;
}

.login-register-form {
    display: flex;
    flex-direction: column;
}

.login-register-form label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #5a5a8a;
}

.login-register-form input[type="text"],
.login-register-form input[type="password"],
.login-register-form input[type="email"] {
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #d6d6ff;
    border-radius: 5px;
    background-color: #fafaff;
    color: #5a5a8a;
    font-size: 14px;
}

.login-register-form button {
    padding: 12px;
    background: linear-gradient(135deg, #8a7bff 0%, #b88cff 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.login-register-form button:hover {
    background: linear-gradient(135deg, #7a6bff 0%, #a87cff 100%);
    box-shadow: 0 4px 10px rgba(138, 123, 255, 0.3);
}

.login-register-link {
    text-align: center;
    margin-top: 15px;
    color: #5a5a8a;
    text-decoration: none;
}

.login-register-link:hover {
    text-decoration: underline;
}
